import { BroadCastCall } from "../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../Framework/MQ/MessageBlock";
import { SShortcut } from "../../../../Message/Game/SShortcut";
import { LadderBattlefieldUtil } from "../../view/ladderBattlefield/LadderBattlefieldUtil";
import { Cache } from "../../cache/Cache";
import { NetDispatcher } from "../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../mvc/ServerCommand";
//class ShortCutsCommand
    
    export  class ShortCutsCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            super.call(arg1);
            var loc1=arg1.messageBase as SShortcut;
            if (LadderBattlefieldUtil.useLadderBattlefieldShortcutsData) 
            {
                loc1.jsStr = LadderBattlefieldUtil.shortJsStrByCareer;
            }
            else if (LadderBattlefieldUtil.isInLadderBattlefield) 
            {
                loc1.jsStr = LadderBattlefieldUtil.getReplaceShortJsStrByCareer(loc1.jsStr);
            }
            Cache.instance.shortCuts.sShortCuts = loc1;
            NetDispatcher.dispatchCmd(ServerCommand.ShortCutsMsg, null);
            return;
        }
    }
